#ifndef __THREAD_H__
#define __THREAD_H__

#define ERR "#erro"
#define PIPE_ERRO   "#erro pipe"
#define FORK_ERRO   "#erro fork"
#define NO_FILENAME "#erro nofilename"
#define OPEN_ERR    "#erro open file failed"
#define LSEEK_ERR   "#erro lseek file failed"
#define UP_ERR      "#erro up file failed"
#define CLOSE_ERR   "#erro  cli close"
#include<pthread.h>
#include"logger.h"
#include"reactor.h"

class Thread
{
public:
  static void* taskFunc(void * arg);
  static void SockPairEventCallback(int fd,short events,void *arg);
   static void ClilentEventCallback(int fd,short events,void *arg);
  Thread();
  ~Thread();

  int GetSocketPairFirst()const;
  int GetSocketPairSecond() const;
  pthread_t GetTid()const;
  static void LSFile(int );
  static void SendFile(int ,char *);
  static void  UpFile(int,char * );
  static void  DeleteFile(int,char *);
  static char * GetCmd(char [],char * []);
private:
   pthread_t  tid_;
   int channel_[2];
   Reactor *reactor_;
};
#endif